if (fooOrBar instanceof Foo){ // TypeScript now knows that `fooOrBar` is `Foo` }
if (typeof abc === "number") { // do something }